package com.blackoreo.monitor.entry;

import java.util.concurrent.atomic.AtomicLong;

/**
 * PackageName: com.blackoreo.monitor.entry
 * Author: txw
 * Date: 2021/4/8
 * Description:
 */
public class CounterEntry extends BlackOreoEntry {

    private AtomicLong value = new AtomicLong(0L);

    public CounterEntry(String name, String description, String unitName) {
        super(name, description, unitName);
    }

    public void reset() {
        this.value = new AtomicLong(0L);
        this.resetTime();
    }

    public long increment() {
        return this.value.incrementAndGet();
    }

    public Long getValue() {
        return value.longValue();
    }
}
